<!--
 @description 快速入口
 @fileName SliderItem.vue
 @author zengqiongying
 @created 2022/02/23 14:40:51
-->
<template>
  <div class="content-scroll">
    <div v-for="(item,i) in list" :key="i" class="content-item" @click.stop="clickHandle(item)">
      <div class="item-img">
        <ImageVideo :host="imgHost" :src="item.coverUrl" fit="contain" />
      </div>
      <div class="item-name">{{ item.linkName }}</div>
    </div>
  </div>
</template>

<script>
import ImageVideo from '@/components/ImageVideo'
export default {
  name: 'FastLinkSliderItem',
  components: {
    ImageVideo
  },
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      imgHost: `${process.env.VUE_APP_STATIC}`
    }
  },

  computed: {},

  created() {},
  activated() {},

  mounted() {},

  methods: {
    clickHandle(item) {
      this.$router.push({ name: 'HelpCenterList', query: { cate: item.categoryId }})
    }
  }
}

</script>
<style lang='less' scoped>
  .content-scroll{
    width: calc(100vw - 20px);
    padding: 0 7px;
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
  }
  .content-item{
    --width: calc(100vw - 20px - 14px - 60px);
    width:calc(var(--width)/4);
    margin-bottom:15px;
    margin-right:20px;
    &:nth-child(4n){
      margin-right:0;
    }
    .item-img{
      margin: 0 auto;
      width: 48px;
      height:48px;
      border-radius:4px;
      // background: #f5f5f5;
      overflow: hidden;
    }
    .item-name{
      width: 100%;
      padding: 4px 0;
      min-height: 20px;
      line-height: 16px;
      box-sizing: border-box;
      text-align: center;
      font-size:12px;
      font-weight:500;
      color: #333;
      letter-spacing: 1px;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
      overflow: hidden;
    }
  }
</style>
